let input = document.querySelector(".uname>input");
let font = document.querySelector(".font>p");
let img = document.querySelector(".QR>img");
let button = document.querySelector(".save>button");

input.value = sessionStorage.getItem("name");
let day_time = sessionStorage.getItem("day_time");
let show_name = sessionStorage.getItem("show_name");
console.log(show_name);
// console.log(day_time.split('-'));
font.innerHTML = `&nbsp;&nbsp;欢迎您在${day_time.slice(5)} ${show_name.split("-")[0]}参观${day_time.slice(0,4)}广州国际花卉艺术展暨中国插花花艺展。`;
// console.log(day_time.splice("-"));
img.src = sessionStorage.getItem("img");

button.addEventListener("click", () => {
    download(img.scr, "预约二维码")
});

function download(url, name) {
    const aLink = document.createElement('a')
    aLink.download = name
    aLink.href = url
    aLink.dispatchEvent(new MouseEvent('click', {}))
}